package worklog.dto;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.google.gson.Gson;

public class ProjectChartDTO {
	private int id;
	private String name; 
	private int hours;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getHours() {
		return hours;
	}

	public void setHours(int hours) {
		this.hours = hours;
	}
	
	public void set(ResultSet res) {
		try { setId(res.getInt("projectID")); } catch (SQLException e) { }
		try { setName(res.getString("name")); } catch (SQLException e) { }
		try { setHours(res.getInt("hours")); } catch (SQLException e) { }
	}

	public String toString() {
		return new Gson().toJson(this);		
	}

}
